1. Field of the Invention
The present invention relates to a method, system, program, and storage cartridge for storing data in a storage medium.
2. Description of the Related Art
Three prevalent tape storage technologies include a helical scan tape where data is stored along vertical or diagonal tracks on the tape, parallel tape where data is stored on tracks in parallel during one scan on the tape, and serpentine tape where data is written in a forward and then reverse direction in a serpentine pattern across bands or tracks on the magnetic tape medium. In serpentine tape drives, the bands extending the length of the tape may be divided into sections, such as a housekeeping section, calibration section, user data section, etc., where data is written in a serpentine manner within the longitudinal bands of a section. A serpentine tape drive first read/writes a track in a forward direction within a section of a band, referred to as a wrap, then read/writes the next track in a reverse direction, and so on, leading to a serpentine pattern for the data layout. In tape technology, a wrap comprises one of the bands that extend the entire length of the tape and a wrap section comprises a section of the wrap.
FIG. 1 illustrates a layout of a tape format in conformance with the Linear Tape Open (LTO) Ultrium format, which is a serpentine tape format technology. The length of the tape is divided into logical points (LPs), which define bounds of regions of the tape. The regions of LP0 to LP1 and LP6 and LP7 are unused as they are at the beginning and end of the tape, the region of LP1 to LP2 is a servo acquisition area, LP2 to LP3 is a calibration area that includes different information in the different bands, LP3 to LP4 is the user data, LP4 to LP5 is an unused user data area and LP5 to LP6 is a servo acquisition region for reverse wraps. The user data section further includes a format identification data set (FID), including information regarding the format of the tape and the tape drive that wrote the FID. In the LTO format, data is written in a serpentine fashion between the logical points each of the data sections between LP3 and LP4.
The access time for a tape drive comprises the time from when the host attachment's input/output (I/O) request is submitted to when the operation is complete. For a Space or Locate command the data should then be in buffer, for a Read command the data has been transferred back to the host. The overall access includes two components: the lateral access and the longitudinal access. Longitudinally every wrap (from LP3 to LP4) may be divided into multiple pieces. In LTO each wrap is divided into two pieces (at the mid-point), each of which is called a wrap section. Laterally data is divided into bands (e.g. the LTO format has 4 data bands), and at any given location there are generally as many wrap sections which can be accessed via lateral movement alone as there are wraps (e.g. there are only 48 wrap sections available via lateral access at any given longitudinal position in LTO, one corresponding to each of the 48 wrap positions, even though there are a total of 96 wrap sections because each of the wraps is longitudinally divided into two wrap sections). Lateral access involves moving the head laterally to the proper wrap, and is limited to approximately 9 mm in the worst case in LTO. Longitudinal access involves moving the tape until the target is either under the head or in buffer. In LTO, if the head begins in the same tape half as the target the maximum required longitudinal access is 290 meters (e.g. BOT to (LP3+LP4)/2), but if the head begins in the opposite tape half it could be as much as 580 m (e.g. BOT to LP4).
To determine the longitudinal position, the tape drive uses the Tape Directory which is stored either on tape or in some auxiliary cartridge memory (e.g. LTO's CM). The tape directory will typically include information at different longitudinal positions on tape which can be used at a minimum to bound the target (e.g. if we know there is one Filemark in a full wrap section all that is known is that the Filemark is between two points such as between LP3 and (LP3+LP4)/2 if it is in the first wrap section). The information to bound the target can also be used in linear interpolation to estimate the target's position (e.g. if we know there are 1 million 1 Kbyte records in a wrap section, then interpolation would suggest that the 400,000th record is approximately 40% of the way between the beginning and end of that wrap section).
One drawback to the relatively inexpensive tape storage is the time required to access data. In fact, the time to wind the tape to the correct longitudinal position can take a minute or more. Thus, the tape access time is primarily determined by the time needed to longitudinally wind the tape to the correct position.
Data may be accessed randomly from the tape. When randomly accessing data, the tape drive may have to wind the tape to entirely different longitudinal positions within the user data area, e.g., the area between LP3 to LP4. The longer the user data area or tape length, the more time required to wind or position the tape medium under the tape head.
Thus, there is a need in the art to provide improved techniques for optimizing access time when randomly accessing data on a tape storage medium.